package com.qf.qfsy2203.config;

import com.qf.qfsy2203.utils.QfFileAppender;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.io.IOException;

@Configuration
@EnableConfigurationProperties(QfsyProperties.class)
public class Qfsy2203AutoConfigure {

    @Autowired
    QfsyProperties qfsyProperties;

    @Bean
    public QfFileAppender qfFileAppender() throws IOException {

        final QfFileAppender qfFileAppender = new QfFileAppender();

        qfFileAppender.setFilepath(qfsyProperties.getFilepath());

        return qfFileAppender;

    }

}
